package edu.nctu.csie.jichang.database.model.builder;

import java.util.List;

import edu.nctu.csie.jichang.database.model.cell.ColumnInfo;
import edu.nctu.csie.jichang.database.model.cell.DBTable;
import edu.nctu.csie.jichang.database.model.cell.NameMap;
import edu.nctu.csie.jichang.database.model.cell.NameMapCell;

public interface ISQLBuilder {

	public String getSQLSchema(String pSchema,String pSQL);

	public String getSQLTableAdd(DBTable pTable);
	public String getSQLTableRemove(DBTable pTable);

	public String getSQLConstraintAdd(DBTable pCurrent,DBTable pBase);
	public String getSQLConstraintRemove(DBTable pCurrent,DBTable pBase);

	public String getSQLColumnAdd(DBTable pTable, ColumnInfo pColumnInfo);
	public String getSQLColumnRemove(DBTable pTable, ColumnInfo pColumnInfo);
	public String getSQLColumnModify(DBTable pTable, ColumnInfo pCurrent,ColumnInfo pBase);
	
	public String getSQLIndex(String pTableName,String pName, List<NameMapCell> pColumns);
	public String getSQLUnique(String pTableName,String pName,List<NameMapCell> pColumns);
	
	public String getSQLPrimaryKey(String pName,List<NameMapCell> pColumns);
	public String getSQLReference(String name, List<NameMapCell> pColumns);
	
	public String getSQLCreateColumnType(ColumnInfo pColumnInfo);
	public String getSQLAlterColumnType(ColumnInfo pColumnInfo);
	
	public String dropIndex(DBTable pTable, NameMap pCurrent,NameMap pBase);
	public String dropUnique(DBTable pTable, NameMap pCurrent,NameMap pBase);
	
}